package com.seria.test01;

import java.io.Serializable;

public class Person extends Humanoid implements Serializable {
	private String lastName;
	private String firstName;
	private transient Thread workerThread;
	private static int population;

	public Person(String lastName, String firstName) {
		this.lastName = lastName;
		this.firstName = firstName;
		synchronized (Person.class) {
			population++;
		}
		System.out.println("Person's constructor is invoked");
	}

	public String toString() {
		return "Person " + firstName + " " + lastName;
	}

	static synchronized public int getPopulation() {
		return population;
	}
}
